package com.hongyun.sdk.utils;

import java.io.IOException;
import java.net.URL;
import java.util.jar.Attributes;
import java.util.jar.Manifest;

public class HongYunSdkInfo {
    public static String get(){
        try {
            URL url = HongYunSdkInfo.class.getResource("/META-INF/MANIFEST.MF");
            Manifest manifest = new Manifest(url.openStream());
            Attributes attributes = manifest.getMainAttributes();
            System.out.println("--------------------------------------------------------");
//            System.out.println("GroupId: " + attributes.getValue("GroupId"));
//            System.out.println("ArtifactId: " + attributes.getValue("ArtifactId"));
//            System.out.println("Version: " + attributes.getValue("Version"));
            System.out.println("GroupId: com.hongyun");
            System.out.println("ArtifactId: hydownstreamclients");
            System.out.println("Version: 1.0.3");
            System.out.println("License: Apache License");
            System.out.println("--------------------------------------------------------");
            return attributes.getValue("Implementation-Version");
        } catch (IOException e) {
            e.printStackTrace();
        }
        return null;
    }
}
